Skip to content

route - #1753

Open
daniel-noland wants to merge 14 commits into
pr/daniel-noland/fuzz-net-headersfrom
pr/daniel-noland/fuzz-routing
Open

route#1753
daniel-noland wants to merge 14 commits into
pr/daniel-noland/fuzz-net-headersfrom
pr/daniel-noland/fuzz-routing

Conversation

@daniel-noland

@daniel-noland daniel-noland commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8d50757e-022b-457b-99e4-3b8a9790f6f0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-net-headers branch from f5188c3 to 75fbc59 Compare August 26, 2026 17:30
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-routing branch from 20dc819 to c54556c Compare August 26, 2026 17:30
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-routing branch from c54556c to e4d6dfb Compare August 26, 2026 19:36
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-net-headers branch from 75fbc59 to 8086c9c Compare August 26, 2026 19:36
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-routing branch from e4d6dfb to ddd5684 Compare August 26, 2026 20:41
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-net-headers branch 2 times, most recently from dd9b98e to 83d440b Compare August 26, 2026 21:02
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-routing branch from ddd5684 to 597e7a7 Compare August 26, 2026 21:02
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-net-headers branch from 83d440b to bbcc339 Compare August 26, 2026 21:13
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-routing branch from 597e7a7 to 7fba952 Compare August 26, 2026 21:13
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-net-headers branch from bbcc339 to 73933c6 Compare August 27, 2026 01:29
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-routing branch from 7fba952 to a1ca24d Compare August 27, 2026 01:29
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-net-headers branch from 73933c6 to 493afc8 Compare August 27, 2026 01:41
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-routing branch from a1ca24d to 6a68c58 Compare August 27, 2026 01:41
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-net-headers branch 3 times, most recently from 8bd7e1c to e7119dc Compare August 27, 2026 03:26
@daniel-noland daniel-noland self-assigned this Aug 27, 2026
@daniel-noland daniel-noland added bug Something isn't working clean-up Code base clean-up, no functional change labels Aug 27, 2026
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-routing branch 2 times, most recently from 4275bcc to 364a49e Compare August 27, 2026 05:09
@daniel-noland
daniel-noland marked this pull request as ready for review August 27, 2026 05:26
@daniel-noland
daniel-noland requested a review from a team as a code owner August 27, 2026 05:26
@daniel-noland
daniel-noland requested review from Fredi-raspall and a lite review from Copilot and removed request for a team August 27, 2026 05:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-net-headers branch 2 times, most recently from 98d9cda to b760312 Compare August 28, 2026 05:11
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-routing branch 2 times, most recently from b5c811d to 27dde18 Compare August 28, 2026 05:26
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-net-headers branch from dd860c4 to 8bf6ba3 Compare August 28, 2026 06:39
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-routing branch 4 times, most recently from 0831e03 to 99bedd4 Compare August 28, 2026 07:43
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-net-headers branch from 8bf6ba3 to 4262cba Compare August 28, 2026 09:14
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-routing branch from 99bedd4 to 89503aa Compare August 28, 2026 09:14
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-net-headers branch from 4262cba to cfaa23b Compare August 28, 2026 17:15
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-routing branch from 89503aa to 566baca Compare August 28, 2026 17:15
daniel-noland and others added 14 commits August 28, 2026 11:32
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
Use changelog to model check fib.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
A fib may be indexed by both id and vni.  Make sure to delete
every entry referring to the target fib so no alias outlives its
writer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
- base receive framing on used (rather than the resized) buffer length.
- Wait for complete headers,
- handle partial bodies,
- reject announced bodies over 16 MiB,

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
An empty-next-hop route in the rib was rejected by the fib.
This allowed traffic to fall through to a less-specific route.
We now substitute an explicit drop so every caller preserves
consistency.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
- generate VRF status transitions
- distinguish preset root-drop routes from ordinary drop routes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
Interface names come from the kernel. Letting these names say in
the key can give the same next-hop different keys.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-net-headers branch from cfaa23b to 18802fb Compare August 28, 2026 17:33
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/fuzz-routing branch from 566baca to bb22af3 Compare August 28, 2026 17:33
#[cfg(test)]
fn quick_resolve_rec(&self, result: &mut BTreeSet<NhopKey>) {
fn quick_resolve_rec(&self, result: &mut BTreeSet<NhopKey>, visited: &mut Visited) {
if visited.contains(&self.id()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to fix but for really deep (say 1k+ routes) the performance here might start to suffer. Isn't there a rust lib to have a small hash table that does a linear array search below a certain size?

fn del_fib(&mut self, id: FibKey) {
info!("Unregistering Fib with id {id} from the FibTable");
self.entries.remove(&id);
self.entries.retain(|_, entry| entry.id != id);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is a big change, are you certain that there is no place where we depend on just removing the thing indexed by id, but instead want to remove all things with a particular id?

@@ -168,7 +175,12 @@ fn fmt_nhop_instruction(f: &mut std::fmt::Formatter<'_>, rc: &Nhop) -> std::fmt:

// formats nhop using the display of the key, recoursing over resolvers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not relevant to the PR, but recoursing isn't the right verb here, recurring is the gerund form for the adjective recursive since they both come from the verb recur.

Heading(format!("Next-hop Store ({})", self.len())).fmt(f)?;
for nhop in self.iter() {
fmt_nhop_rec(f, nhop, 0)?;
fmt_nhop_rec(f, nhop, 0, &mut Visited::new())?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems bad, we are mutating the NhopStore on Display, which is a bad pattern to begin with. Moreover, it seems we never clear this so two next hops that refer to a common nexthop (no loop) would see the visited flag and show as a loop.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at the tests and I'm not sure it would catch this case either.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally, I don't see anywhere that Visited is ever cleared. Is the NextHop store local to the display logic, or somehow ephemeral?

Comment thread routing/src/router/cpi.rs
error!("Unable to find default VRF!");
return RpcResultCode::Failure;
};
vrf0.add_route_rpc(self, None, rmac_store, iftabler);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there reasons we want the interface name? It seems to me that you could get two next hops that are identical apart from the interface name and they might have two different priorities. Why is this change ok?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working clean-up Code base clean-up, no functional change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants